package spring.demo.Validations;

import org.springframework.validation.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class PersonValidatorMain {

	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext(
				new String[] { "context.xml" });
		Person person1 = (Person) context.getBean("personBean");
		PersonValidator personvalidator = new PersonValidator();
		BeanPropertyBindingResult result = new BeanPropertyBindingResult(person1,
				"Errors");
		personvalidator.validate(person1, result);
	}
}
